<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 达达 <ccbox_net@163.com>
// +----------------------------------------------------------------------
namespace app\goods\model;

use think\Model;

class BrandModel extends Model
{

    /**
     * 模型名称
     * @var string
     */
    protected $name = 'goods_brand';

    /**
     * description 自动转化
     * @param $value
     * @return string
     */
    public function getDescriptionAttr($value)
    {
        if (empty($value)) {
            return '';
        }
        return cmf_replace_content_file_url(htmlspecialchars_decode($value));
    }

    /**
     * description 自动转化
     * @param $value
     * @return string
     */
    public function setDescriptionAttr($value)
    {
        if (empty($value)) {
            return '';
        }
        return htmlspecialchars(cmf_replace_content_file_url(htmlspecialchars_decode($value), true));
    }

}